package itzzj.test.Iobyte;

import java.io.*;

public class IoByte01 {

    public static void main(String[] args) throws IOException {
        String projectPath = System.getProperty("user.dir");
        // 源文件
        File source = new File(projectPath + "/描述.txt");
        // 目标文件
        File target = new File(projectPath + "/cope-" + source.getName());
        // 输入流
        InputStream inputStream = new FileInputStream(source);
        // 输出流
        OutputStream outputStream = new FileOutputStream(target);
        byte [] byteArr = new byte[1024];
        int readSign;
        // 从输入流中读取一定数量字节，把它存储在缓存字节中
        while ((readSign = inputStream.read(byteArr)) != -1){
            // 写出
            outputStream.write(byteArr);
        }
        outputStream.close();
        inputStream.close();
    }
}






































